package com.xyz.pringcloud.controller;

import com.xyz.pringcloud.service.PaymentFeignService;
import com.xyz.springcloud.entity.CommonResult;
import com.xyz.springcloud.entity.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 肖咉卓
 */
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id){
        return paymentFeignService.find(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTime(){
        return paymentFeignService.paymentFeignTime();
    }

}
